#ifndef __IMA_DB_INTERFACE_H__
#define __IMA_DB_INTERFACE_H__

#include "ImaConf.h"
#include "postgresql/libpq-fe.h"
#include "ImaInfoRecipient.h"

class ImaDbInterface {
	public:
		static ImaDbInterface* getInstance(ImaConf& conf);
		~ImaDbInterface();

		int getListOfInfoToSend(std::vector<ImaInfo*>& infoVector);
		int getListOfRecipients(const unsigned long infoId, std::vector<ImaRecipient*>& recipientVector);
	private:
		ImaDbInterface(ImaConf& conf);
		int connectToDb();
		char mDbHostname[256];
		int mDbPort;
		char mDbName[256];
		char mDbUsername[256];
		char mDbPassword[256];
		PGconn *mpConn;

		static ImaDbInterface* mpDbInterface;
};

#endif //__IMA_DB_INTERFACE_H__
